<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        'App\Console\Commands\CancelOrderCommand',
        'App\Console\Commands\OverdueOrderCommand',
        'App\Console\Commands\OverdueReminderCommand',
        'App\Console\Commands\RepaymentReminderCommand',
        'App\Console\Commands\SuggestTimeCommand',
        'App\Console\Commands\WithholdCommand',
        'App\Console\Commands\WithholdCountCommand',
        'App\Console\Commands\OtherOrderSyncCommand',
        'App\Console\Commands\ZlbV1Command',
        'App\Console\Commands\FinanceCheckOrderSettleCommand',
        'App\Console\Commands\OverdueReminderBeyondCommand',
        'App\Console\Commands\OtherBeiKeOrderSyncCommand',
        'App\Console\Commands\ConfirmOrderCommand',
        'App\Console\Commands\AccountIssuanceReminderCommand',
        'App\Console\Commands\WaitPayOrderCommand',
        'App\Console\Commands\YifubaoPayOrderLeaseCommand',
        'App\Console\Commands\RiskOrderDataSyncCommand',


    ];

    /**
     * Define the application's command schedule.
     *->cron(‘* * * * *’); 在自定义Cron调度上运行任务
    ->everyMinute(); 每分钟运行一次任务
    ->everyFiveMinutes(); 每五分钟运行一次任务
    ->everyTenMinutes(); 每十分钟运行一次任务
    ->everyThirtyMinutes(); 每三十分钟运行一次任务
    ->hourly(); 每小时运行一次任务
    ->daily(); 每天凌晨零点运行任务
    ->dailyAt(‘13:00’); 每天13:00运行任务
    ->twiceDaily(1, 13); 每天1:00 & 13:00运行任务
    ->weekly(); 每周运行一次任务
    ->monthly(); 每月运行一次任务
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
         set_time_limit(0);
         ini_set('memory_limit', '-1');
         $schedule->command('cancelOrder')->everyThirtyMinutes();//每5分钟运行一次 取消订单操作
         $schedule->command('overdueOrder')->cron('0 0 * * *');//每天0点运行一次 逾期订单筛选操作
//         $schedule->command('withholdCountOrder')->cron('50 6,11,17 * * *');//每天6,11,17时50分各运行一次扣款数据统计

//         $schedule->command('repaymentReminder')->dailyAt('09:26');//每天9时运行一次 还款提醒
//         $schedule->command('overdueReminder')->dailyAt('08:30');//每天8时运行一次 订单逾期短信提醒
         $schedule->command('AccountIssuanceReminder')->dailyAt('08:30');//出账提醒

//
//         $schedule->command('repaymentReminder')->dailyAt('11:30');//每天11:30时运行一次 还款语音提醒
//         $schedule->command('overdueReminder')->dailyAt('11:30');//每天11:30时运行一次 订单逾期语音短信提醒
         $schedule->command('FinanceCheckOrderSettle')->hourly();//每小时运行一次订单结算一次

//         $schedule->command('OverdueReminderBeyond')->dailyAt('11:30');//每天11:30时运行一次,逾期超15天提醒

//         $schedule->command('SuggestTime')->everyFiveMinutes();//每小时运行一次首页数据同步oss

         $schedule->command('ConfirmOrder')->twiceDaily(9, 15);//确认收货

         $schedule->command('WaitPayOrder')->hourly();//每小时运行一次首页数据同步oss

         $schedule->command('RiskOrderDataSync')->dailyAt('01:30');//每日1:30时运行一次订单数据同步


    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
